package model.tobj;

import model.collect.bxbusDis;

public class stationData {
	
	private String sid;//唯一编码
    private int stationnum;
    private bxbusDis lastdata;
    private bxbusDis newdata;
    private long headway;
    private int updown;
	public stationData(String sid, int stationnum, int updown) {
		super();
		this.sid = sid;
		this.stationnum = stationnum;
		this.updown = updown;
	}
	public String getSid() {
		return sid;
	}
	public void setSid(String sid) {
		this.sid = sid;
	}
	public int getStationnum() {
		return stationnum;
	}
	public void setStationnum(int stationnum) {
		this.stationnum = stationnum;
	}
	public bxbusDis getLast() {
		return lastdata;
	}
	public void setLast(bxbusDis last) {
		this.lastdata = last;
	}
	public bxbusDis getNewdata() {
		return newdata;
	}
	public void setNewdata(bxbusDis newdata) {
		this.newdata = newdata;
	}
	public long getHeadway() {
		return headway;
	}
	public void setHeadway(long headway) {
		this.headway = headway;
	}
	public int getUpdown() {
		return updown;
	}
	public void setUpdown(int updown) {
		this.updown = updown;
	}
	public void calcheadway(){
		this.headway=-1;
		if ((lastdata!=null)&&(newdata!=null)){
			this.headway= newdata.getTime()-lastdata.getTime();
			if(this.headway>1000){
				this.headway=-1;
			}
		}
	}

}
